﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.ComponentModel;

namespace ShootSearch.Spiders
{
    #region Update Mode Enum
    /// <summary>
    /// Update Mode Enum
    /// </summary>
    public enum UpdateModeType
    {
        /// <summary>
        /// Only new url will be downloaded
        /// </summary>
        NewOnly,
        /// <summary>
        /// All the url will be downloaded
        /// </summary>
        All,
        /// <summary>
        /// Does not support update
        /// </summary>
        None
    }
    #endregion    

    #region Mutiple file system enum
    /// <summary>
    /// Mutiple file system enum
    /// </summary>
    public enum MultiFileSystemType
    {
        /// <summary>
        /// By size
        /// </summary>
        BySzie,
        /// <summary>
        /// by date time
        /// </summary>
        ByDateTime
    }
    #endregion


    #region Binary file description
    /// <summary>
    /// Binary file description
    /// </summary>
    [XmlRoot("FileType")]
    [DescriptionAttribute("Binary file description")]
    public class BinFileDescType
    {
        private string extension;

        /// <summary>
        /// File extension
        /// </summary>
        [XmlAttribute]
        [CategoryAttribute("File Type"),
            DescriptionAttribute("File extension")]
        public string Extension
        {
            get { return extension; }
            set { extension = value.ToLower(); }
        }

        private string contentType;

        /// <summary>
        /// The file ContentType (MIME)
        /// </summary>
        [XmlAttribute]
        [CategoryAttribute("File Type"),
            DescriptionAttribute("The file ContentType (MIME)")]
        public string ContentType
        {
            get { return contentType; }
            set { contentType = value.ToLower(); }
        }

        private string comment;
        /// <summary>
        /// Comment
        /// </summary>
        [XmlAttribute]
        [CategoryAttribute("File Type"),
            DescriptionAttribute("Comment")]
        public string Comment
        {
            get { return comment; }
            set { comment = value; }
        }


        /// <summary>
        /// Constructor
        /// </summary>
        public BinFileDescType() { }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="ext">Extension</param>
        /// <param name="mime">ContentType(MIME)</param>
        /// <param name="comment">Comment</param>
        public BinFileDescType(string ext, string contentType, string comment)
        {
            this.extension = ext.ToLower();
            this.contentType = contentType.ToLower();
            this.comment = comment;
        }
    }
    #endregion
}
